<template>
  <div class="text">正在前往百搜店铺</div>
</template>

<script lang="ts" setup>
import MD5 from 'crypto-js/md5'
import { useMainStore } from '@/store/useMainStore'
import { onMounted } from 'vue'

const { VITE_HAOJING_API_SECRET, VITE_HAOJING_HOST } = import.meta.env

const mainStore = useMainStore()
const hash = MD5(`${mainStore.userMobile}${VITE_HAOJING_API_SECRET}`).toString()

// const url = `${VITE_HAOJING_HOST}?mobile=${mainStore.userMobile}&hash=${hash}`
const url = `https://shop.e-baixing.com/shop?jumpLogin=${mainStore.userMobile}`
console.log(url, hash, mainStore.userMobile, '跳转百搜店铺')
// shop.e-baixing.com/shop?jumpLogin=
// https://shop.e-baixing.com/shop
onMounted(() => {
  window.open(url)
})
</script>

<style lang="scss" scoped>
.text {
  font-size: 50px;
  text-align: center;
  margin-top: 200px;
  color: #d7d8da;
}

.bax {
  height: 1000px;
}
</style>
